<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import 'element-ui/lib/theme-chalk/display.css'

export default {
  name: 'App',
  computed: {
    getToken () {
      console.log(this.$store.state.token)
      return this.$store.state.token
    }
  },
  watch: {
    getToken: {
      handler (val) {
        this.isLogin = !!this.getToken
      }
    }
  },
  data () {
    return {
      activeIndex: 'login',
      isLogin: !!localStorage.getItem(process.env.VUE_APP_TOKEN)
    }
  },
  destroyed () {

  },
  methods: {
    loginOut () {
      localStorage.removeItem(process.env.VUE_APP_TOKEN)
      this.$store.state.token = null
    }
  }
}
</script>

<style lang="stylus">
#app
  font-family Avenir, Helvetica, Arial, sans-serif
  -webkit-font-smoothing antialiased
  -moz-osx-font-smoothing grayscale
  /*text-align center*/
  color #2c3e50
</style>
